public class LeetCode461 {
    public static void main(String[] args) {
        //汉明距离
        //https://leetcode.cn/problems/hamming-distance/description/
    }
}

class Solution461 {
    public int hammingDistance(int x, int y) {
        int m = x ^ y;
        int count = 0;
        for (int i = 0; i < 32; i++) {
            int flg = m % 2;
            if(flg == 1){
                count ++;
            }
            m = m>>1;
        }
        return count;
    }
}
